<?php use_helper('I18N') ?>
<div class="createAccountTitle"><?php echo __('Register - Your Group', null, 'sf_guard') ?></div>

<?php $formFindGroup = new GoSharkFindGroupForm(); ?>
<?php $formCreateGroup = new GoSharkCreateGroupForm(); ?>

<div class="createAccount">
<form action="<?php echo url_for('@sf_guard_register_find_group') ?>" method="post">
    
  <table>
    <tfoot>
      <tr>
        <td colspan="4">
          <ul class="error_list">
            <?php foreach ($formFindGroup->getGlobalErrors() as $name => $error): ?>
              <li><?php echo $name.': '.$error ?></li>
            <?php endforeach; ?>
          </ul>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <input type="submit" name="findgroup" value="<?php echo __('Join', null, 'sf_guard') ?>" />
          <?php echo $formFindGroup->renderHiddenFields(); ?>
        </td>
      </tr>
    </tfoot>
    <tbody>
        <tr>
            <td>
                <?php echo $formFindGroup['group_name']->renderLabel('Find Group: '); ?>
            </td> 
            <td>
                <?php echo $formFindGroup['group_name']->render(); ?>
            </td>
            <td>
                <img id="loader" src=<?php echo sfConfig::get('sf_web_dir') . "\images\loader.gif"; ?> style="vertical-align: middle; display: none" />
            </td>
            <td>
                <?php echo $formFindGroup['group_name']->renderError(); ?>
            </td>
        </tr>
        <tr>
            <td><span id="groupFound" style="font-size:10px"><?php //echo $groups?></span></td>
        </tr>
        <?php echo $formFindGroup['password']->renderRow(array(), 'Password: '); ?>
    </tbody>
  </table>
</form>
<form action="<?php echo url_for('@sf_guard_register_create_group') ?>" method="post">
    
  <table>
    <tfoot>
      <tr>
        <td colspan="4">
          <ul class="error_list">
            <?php foreach ($formCreateGroup->getGlobalErrors() as $name => $error): ?>
              <li><?php echo $name.': '.$error ?></li>
            <?php endforeach; ?>
          </ul>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <input type="submit" name="findgroup2" value="<?php echo __('Create', null, 'sf_guard') ?>" />
          <?php echo $formCreateGroup->renderHiddenFields(); ?>
        </td>
      </tr>
    </tfoot>
    <tbody>
        <?php echo $formCreateGroup['group_name']->renderRow(array(), 'Create Group: '); ?>
        <?php echo $formCreateGroup['password']->renderRow(array(), 'Password: '); ?>
        <?php echo $formCreateGroup['password_again']->renderRow(array(), 'Password again: '); ?>
    </tbody>
  </table>
</form>

</div>